home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
shared.dir
/
03023_Script_SET SECTION INFO
< prev
next >
Wrap
Text File
|
1996-06-21
|
7KB
|
202 lines
-- ---------------------------------------------------------------
-- Handler getSectionInfo returns the line in the global variable
-- navigationInfo that contains the information for the given
-- section name.
on getSectionInfo sectionName
global navigationInfo
set SectionInfoLine = BinSearchFirstItemInLine (navigationInfo, sectionName)
if SectionInfoLine > 0 then return line SectionInfoLine of navigationInfo
-----------------------------------------------------------------------------
-- Error Handling. If data is correct, should not get here.
--
-- alert "Section Not Found: ""e§ionName"e&return&"Movie: "&the moviename&return&"Frame: "&the frame
return ""
-- should return current section info, so user will have least possible disturbance.
-----------------------------------------------------------------------------
end
-- ---------------------------------------------------------------
-- Handler setSectionMovie sets the global variable sectionMovie to
-- the movie name of the section with the given section information.
on setSectionMovie sectionInfo
global sectionMovie
set sectionMovie = item 2 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setSectionFrame sets the global variable sectionFrame to
-- the frame name of the section with the given section information.
on setSectionFrame sectionInfo
global sectionFrame
set sectionFrame = item 3 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setLeftSection sets the global variable leftSection to
-- the name of the section to the left of the section with the given
-- section information. (This value will be 0 if no left section exists.)
on setLeftSection sectionInfo
global leftSection
set leftSection = item 4 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setRightSection sets the global variable rightSection to
-- the name of the section to the right of the section with the given
-- section information. (This value will be 0 if no left section exists.)
on setRightSection sectionInfo
global rightSection
set rightSection = item 5 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setTopSection sets the global variable topSection to
-- the name of the section to the top of the section with the given
-- section information. (This value will be 0 if no left section exists.)
on setTopSection sectionInfo
global topSection
set topSection = item 6 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setBottomSection sets the global variable bottomSection
-- to the name of the section to the bottom of the section with the given
-- section information. (This value will be 0 if no left section exists.)
on setBottomSection sectionInfo
global bottomSection
set bottomSection = item 7 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setParentSection sets the global variable parentSection
-- to the name of the parent section of the section with the given
-- section information. (This value will be 0 if no left section exists.)
on setParentSection sectionInfo
global parentSection
set parentSection = item 8 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler getParentSection returns the parentSection of the given
-- section information.
on getParentSection sectionInfo
return item 8 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setNumSectionButtons sets the global variable
-- numSectionButtons to the number of menu buttons in the section
-- with the given section information.
on setNumSectionButtons sectionInfo
global numSectionButtons
set numSectionButtons = value(item 9 of sectionInfo)
end
-- ---------------------------------------------------------------
-- Handler resetListOfButtonTexts
on resetListOfButtonTexts
global listOfButtonTexts
set listOfButtonTexts = []
end
-- ---------------------------------------------------------------
-- Handler setButtonTexts sets the text for all the buttons in
-- the section with the given section information.
on setButtonTexts sectionInfo
global numSectionButtons, listOfButtonTexts
resetListOfButtonTexts
repeat with i = 1 to numSectionButtons
add(listOfButtonTexts,getButtonText(sectionInfo, i))
end repeat
end
-- ---------------------------------------------------------------
-- Handler getButtonText returns the text of the button with the
-- given buttonIndex in the section with the given section
-- information.
on getButtonText sectionInfo, buttonIndex
global buttonItemOffset
return word 1 of item (buttonItemOffset+buttonIndex) of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler resetListOfButtonSections
on resetListOfButtonSections
global listOfButtonSections
set listOfButtonSections = []
end
-- ---------------------------------------------------------------
-- Handler setButtonSections sets the destination section for all
-- the buttons in the section with the given section information.
on setButtonSections sectionInfo
global numSectionButtons, listOfButtonSections
resetListOfButtonSections
repeat with i = 1 to numSectionButtons
add(listOfButtonSections,getButtonSection(sectionInfo, i))
end repeat
end
-- ---------------------------------------------------------------
-- Handler getButtonSection returns the name of the section to go
-- to when the button with the given buttonIndex in the section with
-- the given section information is clicked.
on getButtonSection sectionInfo, buttonIndex
global buttonItemOffset
return word 2 of item (buttonItemOffset+buttonIndex) of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler setSectionOrientation sets the global variable
-- sectionOrientation to the orientation of the section
-- with the given section information.
on setSectionOrientation sectionInfo
global sectionOrientation
set sectionOrientation = item 13 of sectionInfo
end
-- ---------------------------------------------------------------
-- Handler getSectionOrientation returns the orientation in the
-- given section information
on getSectionOrientation sectionInfo
return item 13 of sectionInfo
end